mat1 = gr.material({1.0, 0, 0}, {0.5, 0.7, 0.5}, 25)
mat2 = gr.material({0.5, 0.5, 0.5}, {0.5, 0.7, 0.5}, 25)
mat3 = gr.material({1.0, 0.6, 0.1}, {0.5, 0.7, 0.5}, 25)
mat4 = gr.material({0.7, 0.6, 1.0}, {0.5, 0.4, 0.8}, 25)

scene_root = gr.node('root')
scene_root:translate(0,0,-250)

cylinder1 = gr.cylinder('cylinder1',30,20)
cylinder1:set_material(mat1)
cylinder1:translate(-50,-70,0)
cylinder1:rotate('z',3)


cone1 = gr.cone('cone1',30,40)
cone1:set_material(mat2)
cone1:translate(-50,-20,0)
cone1:rotate('x', 40)

torus1 = gr.torus('torus1',10,25)
torus1:set_material(mat3)
torus1:translate(-50,70,0)
torus1:rotate('x', -60)

cube1 = gr.nh_box('cube1',{35, -10,0},35)
cube1:set_material(mat4)

sphere1 = gr.nh_sphere('sphere1',{53, 70,0},25)
sphere1:set_material(mat1)

require('smstdodeca')
steldodec:set_material(mat3)
steldodec:translate(150,-160,0)
steldodec:scale(0.5,0.5,0.5)

scene_root:add_child(sphere1)
scene_root:add_child(cube1)
scene_root:add_child(steldodec)
scene_root:add_child(cylinder1)
scene_root:add_child(cone1)
scene_root:add_child(torus1)

white_light = gr.light({-100.0, 150.0, 400.0}, {0.9, 0.9, 0.9}, {1, 0, 0})
orange_light = gr.light({400.0, 100.0, 150.0}, {0.7, 0.0, 0.7}, {1, 0, 0})

gr.render(scene_root, 'subdivision.png', 500, 500,
	  {0, 0, 0}, {0, 0, -1}, {0, 1, 0}, 50,
	  {0.3, 0.3, 0.3}, {white_light, orange_light})
	
--	real	0m13.139s
--	user	0m12.949s
--	sys	0m0.029s
-- real	0m11.247s
-- user	0m11.143s
--sys	0m0.026s
